<template>
  <div class="shop-page">
    <div class="header">
      <div class="close" @click="back">
        <!-- <img src="@/assets/images/back.svg" alt="" /> -->
        <div class="word">Shop</div>
      </div>
      <div class="count">
        <img src="@/assets/images/imgGemSquare.png" alt="" />
        <div class="num">0</div>
      </div>
    </div>
    <div class="discount">
      <div class="box">
        <div class="line">
          <img src="@/assets/images/gift-fill.svg" alt="" />
          <div>Web-only Special Offer!</div>
        </div>
        <div class="tip">10% Web Bonus</div>
        <div class="line">10% bonus gems in total</div>
      </div>
    </div>
    <div class="goods-list">
      <div class="wrapper">
        <div
          class="goods-item"
          v-for="(item, index) in goods"
          :key="item.amount"
        >
          <div
            class="pic"
            :style="{
              background:
                index === 0
                  ? '#23b2f6'
                  : index === 1
                  ? '#ff9c54'
                  : index === 2
                  ? '#991dcb'
                  : index === 3
                  ? '#ef5f12'
                  : index === 4
                  ? '#f8424e'
                  : index === 5
                  ? '#be1e28'
                  : '',
            }"
          >
            <img v-if="index === 0" src="@/assets/images/VIP1.png" alt="" />
            <img v-if="index === 1" src="@/assets/images/VIP2.png" alt="" />
            <img v-if="index === 2" src="@/assets/images/VIP3.png" alt="" />
            <img v-if="index === 3" src="@/assets/images/VIP4.png" alt="" />
            <img v-if="index === 4" src="@/assets/images/VIP5.png" alt="" />
            <img v-if="index === 5" src="@/assets/images/VIP6.png" alt="" />
          </div>
          <div class="detail">
            <div class="name">{{ item.amount }} Gems</div>
            <div class="tip">+ {{ item.discount }} Gems</div>
            <div class="price">${{ item.price }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import { useRouter } from "vue-router";
const goods = reactive([
  {
    amount: 25000,
    discount: 2500,
    price: 181.99,
  },
  {
    amount: 10000,
    discount: 1000,
    price: 74.99,
  },
  {
    amount: 5000,
    discount: 500,
    price: 37.99,
  },
  {
    amount: 2500,
    discount: 250,
    price: 19.49,
  },
  {
    amount: 1000,
    discount: 100,
    price: 7.99,
  },
  {
    amount: 500,
    discount: 50,
    price: 4.19,
  },
]);
const router = useRouter();
const back = () => {
  router.back();
};
</script>

<style lang="less">
.shop-page {
  background-color: #232e3c;
  padding-bottom: 25px;
  .header {
    display: flex;
    justify-content: space-between;
    // height: 44px;
    line-height: 44px;
    padding: 10px 20px;
    .close {
      display: flex;
      img {
        width: 20px;
        height: 20px;
        margin-top: 12px;
        margin-right: 10px;
      }
      .word {
        color: #fff;
        font-weight: bold;
        font-size: 20px;
      }
    }
    .count {
      display: flex;
      img {
        width: 24px;
        height: 24px;
        margin-top: 10px;
        margin-right: 10px;
      }
      .num {
        color: #fff;
        font-weight: bold;
        font-size: 20px;
        font-family: Arial;
      }
    }
  }
  .discount {
    padding: 0 20px;
    .box {
      padding: 15px 10px;
      font-size: 16px;
      text-align: center;
      background: rgba(0, 0, 0, 0.6);
      box-shadow: 2px 2px 10px rgba(255, 255, 255, 0.1);
      border-radius: 15px;
      .line {
        display: flex;
        justify-content: center;
        font-weight: bold;
        line-height: 30px;
        color: #fff;
        img {
          width: 24px;
          margin-right: 10px;
        }
      }
      .tip {
        color: #00f69d;
        margin: 5px 0;
      }
    }
  }
  .goods-list {
    padding: 0 20px;
    margin: 20px 0;
    .wrapper {
      .goods-item {
        background-color: rgba(34, 34, 34, 0.8);
        border-radius: 15px;
        display: flex;
        overflow: hidden;
        box-shadow: 2px 2px 10px rgba(255, 255, 255, 0.1);
        margin-bottom: 15px;
        .pic {
          width: 32%;
          display: flex;
          flex-direction: column;
          justify-content: center;
          background-color: #23b2f6;
          img {
            width: 50px;
            margin: 0 auto;
          }
        }
        .detail {
          flex: 1;
          padding: 15px 15px;
          .name {
            font-size: 20px;
            font-weight: bold;
            line-height: 30px;
            color: #fff;
          }
          .tip {
            color: #00f69d;
            font-size: 14px;
            margin-bottom: 15px;
          }
          .price {
            background-color: rgba(80, 80, 80, 0.6);
            border-radius: 8px;
            line-height: 32px;
            font-size: 16px;
            text-align: center;
            font-weight: bold;
            color: #fff;
          }
        }
      }
    }
  }
}
</style>
